#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>

int main() {
	int n, k;
	scanf("%d%d", &n, &k);
	int* arr = (int*)malloc(sizeof(int) * n);
	for (int i = 0; i < n; i++) {
		scanf("%d", &arr[i]);
	}
	int count = 0;
	for (int i = 0; i < n; i++) {
		int temp = 0;
		for (int j = i; j < n; j++) {
			temp += arr[j];
			if (temp % k == 0 && temp >= k)
			{
				count++;
				int test = 0;
			}
		}
	}
	free(arr);
	printf("%d", count);
	return 0;
}